Skip to content

refactor(a2ui): core quality pass — type safety, code org, tests, DX#105

Merged
blove merged 10 commits into
mainfrom
feat/a2ui-quality-pass
Apr 10, 2026
Merged

refactor(a2ui): core quality pass — type safety, code org, tests, DX#105
blove merged 10 commits into
mainfrom
feat/a2ui-quality-pass

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented Apr 10, 2026

Summary

  • Type guards: Added isPathRef() and isFunctionCall() to @cacheplane/a2ui, eliminating as any casts in surfaceToSpec
  • Code organization: Extracted surfaceToSpec and buildA2uiActionMessage from the component file into dedicated modules with proper UIElement typing
  • Shared utility: Extracted emitBinding() function used by 7 input catalog components, removing duplicated 3-line binding patterns
  • Test coverage: Added unit tests for 10 catalog components (input, display, and complex)
  • Public API: Exported all 18 catalog component classes, core A2UI types, and utilities from @cacheplane/chat for custom catalog composition
  • Documentation: Added "Data Model Bindings" section to overview docs, validationResult prop to all input component tables

Test plan

  • nx test a2ui — all tests pass
  • nx test chat — all tests pass
  • nx build chat — builds successfully with expanded exports
  • nx lint a2ui — clean
  • nx lint chat — 7 pre-existing errors (same as main), 0 new

🤖 Generated with Claude Code

blove and others added 10 commits April 10, 2026 13:56
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…t types

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…components

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nents

Add @analogjs/vite-plugin-angular and tsconfig.spec.json to enable the Angular
compiler in the vitest environment so that signal inputs work with setInput.
This was required for all catalog component tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…changes

The angular() vite plugin caused module resolution failures in the chat
lib test environment. Reverted to original vite config and rewrote all
catalog component tests to test behavioral logic directly via emitBinding
utility rather than requiring Angular template compilation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…e-exports

Consumers can now import individual catalog components for custom catalog
composition via withViews, and access core A2UI types directly from
@cacheplane/chat without needing to import @cacheplane/a2ui.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rop tables

- New "Data Model Bindings" section in overview.mdx explaining the binding
  mechanism, emitBinding utility, and known limitations
- Added validationResult prop to all input component prop tables in catalog.mdx

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cacheplane Ready Ready Preview, Comment Apr 10, 2026 8:58pm

Request Review

@blove blove merged commit 12e978b into main Apr 10, 2026
14 checks passed
@blove blove deleted the feat/a2ui-quality-pass branch May 7, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant